home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Productivity Pak 1 / rerun-productivity-pak-i.d64 / dfreport (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  8KB  |  253 lines

  1. 500 rem-datafile 3.3 subprogram dfreport by mike konshak (c)1983
  2. 502 ifx=0thenprint" please load and run datafile[146]":end
  3. 504 open4,4:ifpw=0thenpw=80
  4. 506 gosub4000:goto614
  5. 508 rem----subprograms
  6. 510 print"[147]       loading main program"
  7. 512 load"datafile",8
  8. 514 print"[147]  loading mailing label subprogram"
  9. 516 load"  dfmail",8
  10. 518 rem----quit routine
  11. 520 print"[147]quiting now will erase current data"
  12. 522 print"are you sure you want to quit?":print" y[146] or n[146] ?
  13. 524 [161]a$:[139]a$[178]"" [167]524
  14. 526 [139]a$[178]"n"[167]614
  15. 528 [139]a$[178]"y"[167]532
  16. 530 [137]524
  17. 532 [160]4:[153]"loadsubprogram terminated"
  18. 534 [153]"datafilewait by mike konshak (c)1983":[128]
  19. 536 [143]----search
  20. 538 a0[178]0:[153]"load            print options menu        "
  21. 540 [153]"    awaitll records in file
  22. 542 print"    s[146]elect individual records
  23. 544 [153]"    fwaitind records with common fields
  24. 546 print"    e[146]xit to main menu
  25. 548 [153]"position paper in printer at top of page"
  26. 550 [153]"printer may stop during printing if the"
  27. 552 [153]"computer needs to reallocate memory."
  28. 554 [153]"       press the appropriate key       "
  29. 556 [161]c$:[139]c$[178]"" [167]556
  30. 558 [139]c$[178]"a"[167]606
  31. 560 [139]c$[178]"s"[167]fl[178]0:[137]570
  32. 562 [139]c$[178]"f"[167]580
  33. 564 [139]c$[178]"e"[167]614
  34. 566 [137]556
  35. 568 [143]----select record
  36. 570 [133]"loadprint which record (0wait to exit)";i$:i[178][197](i$):[139]i[178]0[167]890
  37. 572 [139]i[177]x[167][153]"no such record exists!ononon":[129]s[178]1[164]1000:[130]s:[137]570
  38. 574 [139]k[178]2[175]fl[178]0[167][141]810:[141]824:[141]842:[141]888:fl[178]1:[137]570
  39. 575 [139]k[178]2[175]fl[178]1[167][141]842:[141]888:[137]570
  40. 576 [141]798:[141]4034:[137]538
  41. 578 [143]----search
  42. 580 [153]"load     find records with common items    "
  43. 582 [129] n[178]1[164]f:[153]" ";n;"wait ";f$(n):[130]n
  44. 584 [133]"which field is to be searched";sf
  45. 586 [139]sf[179]0[176]sf[177]f[167][153]"ononon":[137]584
  46. 588 [153]"enter common itemwait ":[153]"(the entire string is not required)"
  47. 590 [153]"";f$(sf);"wait ";:[133]t$
  48. 592 [139]k[178]2[167][141]810:[141]824
  49. 594 [129]i[178]1[164]x
  50. 596 [153]"searching record";i;"onon"
  51. 598 [139]t$[178][200](rec$(k%(i),sf),[195](t$))[167][145]k[141]798,842:[141]888
  52. 600 [130]i
  53. 602 [137]890
  54. 604 [143]----print all
  55. 606 [133]"load start at record? 1cmdcmdcmd";s:[139]s[177]x[176]s[179]1[167]606
  56. 607 [153]"load printing heading":[139]k[178]2[167][141]810:[141]824
  57. 608 [129]i[178]s[164]x:[153]"on printing record #";i:[145]k[141]798,842:[141]888:[130]i
  58. 610 [137]890
  59. 612 [143]----print records menu
  60. 614 [153]"load         report printout menu          "
  61. 616 [153]"      lwaitist records unformatted"
  62. 618 [153]"      pwaitre-defined format or"
  63. 620 [153]"      dwaitefine new format"
  64. 621 [153]"      cwaitonfigure printer"
  65. 622 [153]"      ewaitxit to main program or"
  66. 624 [153]"      mwaitailing label program"
  67. 626 [153]"      qwaituit program"
  68. 628 [153]"       press the appropriate key       "
  69. 630 [161]c$:[139]c$[178]"" [167]630
  70. 632 [139]c$[178]"l"[167]k[178]1:[137]538
  71. 633 [139]c$[178]"c"[167][141]4000:[137]614
  72. 634 [139]c$[178]"p"[167]k[178]2:[137]766
  73. 636 [139]c$[178]"e"[167][160]4:[137]510
  74. 638 [139]c$[178]"m"[167][160]4:[137]514
  75. 640 [139]c$[178]"d"[167]k[178]2:[137]646
  76. 642 [139]c$[178]"q"[167]520
  77. 644 [137]630
  78. 646 [153]"loadreport sizewait up to 136 character wide."
  79. 648 [153]"printer must be initialized for widths"
  80. 650 [153]"greater than 80 characters. check your"
  81. 652 [153]"printer manual to how to print 136 chrs"
  82. 654 [153]"number of characters?":[153]"?   cmdcmdcmd";pw:[133]"on";pw
  83. 656 [139]pw[177]136[167]654
  84. 658 [153]"loadtitle formatwait up to 4 title lines of"
  85. 660 [153]"information at the top of the form."
  86. 662 [153]"number of lines?":[153]"?   cmdcmdcmd";nl:[133]"on";nl:[139]nl[177]4[167]662
  87. 664 [129]j[178]1[164]nl:[153]"title #";j:[153]"? >  cmdcmdcmd";tt$(j)
  88. 666 [139][195](tt$(j))[177]37[167][153]"on";
  89. 668 [133]"on";tt$(j):[139]tt$(j)[178]""[167]tt$(j)[178]">"
  90. 670 [130]j
  91. 672 [153]"loadcolumn formatwait up to 8 columns with 2":[153]"spaces between columns"
  92. 674 [153]"number of columns?":[153]"?   cmdcmdcmd";nc:[133]"on";nc:[139]nc[177]8[167]674
  93. 676 [129]j[178]1[164]nc:[153]"position of column #";j:[153]"?   cmdcmdcmd";pc(j)
  94. 678 [133]"on";pc(j):[130]j
  95. 680 [153]"loadheading formatwait column headings cannot"
  96. 682 [153]"exceed width of columns:"
  97. 684 [129]j[178]1[164]nc:[153]"column";j;" heading";
  98. 686 [139]j[178]nc[167][153]80[171]pc(j);:[137]690
  99. 688 [153]pc(j[170]1)[171]2[171]pc(j);
  100. 690 [153]" characters wide"
  101. 692 [153]"? >  cmdcmdcmd";hc$(j):[133]"on";hc$(j):[139]hc$(j)[178]""[167]hc$(j)[178]">"
  102. 694 [130]j
  103. 696 [153]"loadchoose which fields go under the columns"
  104. 698 [153]"enter 0wait if additional fields are":[153]"not desired."
  105. 700 [129]n[178]1[164]f:[153]"";n;"wait ";f$(n):[130]n
  106. 702 [129]j[178]1[164]nc:[153]"";[163]25)"column";j;""
  107. 704 [129]l[178]1[164]3:[153][163]25)"onfield";l;" 0 cmdcmd";ml$(j,l)
  108. 706 [153][163]32);"on";:[133]ml$(j,l):[130]l:[130]j
  109. 708 [153]"loaddo you wish to sum the data in column"[170][196](nc)[170]"?"
  110. 709 [153]"this column must only be formatted with"
  111. 710 [153]"only one field. enter 1wait (yes) or 0wait (n0)"
  112. 711 [153]"?";z:[133]"on";z
  113. 712 [153]"loaddo you wish to review your format and/or"
  114. 714 [153]"make corrections?  press ywait or nwait"
  115. 716 [161]a$:[139]a$[178]""[167]716
  116. 718 [139]a$[178]"y"[167]646
  117. 720 [139]a$[178]"n"[167]726
  118. 722 [137]716
  119. 724 [143]----save format
  120. 726 [153]" save formatwait?            ywait or nwait"
  121. 728 [161]a$:[139]a$[178]""[167]728
  122. 730 [139]a$[178]"n"[167]538
  123. 732 [139]a$[178]"y"[167]736
  124. 734 [137]728
  125. 736 [153]"save under what file name?"
  126. 738 [153]"  ";nf$:[133]"on";nf$:[139]nf$[178]""[167]614
  127. 740 [159]15,8,15:[152]15,"s0:rp] "[170]nf$:[141]876:[139]et[178]8[167]614
  128. 742 [159]5,8,5,"0:rp] "[170]nf$[170]",s,w":[141]876:[139]et[178]8[167]614
  129. 744 [152]5,pw;cr$;nl;cr$;nc:[141]876:[139]et[178]8[167]614
  130. 746 [129]j[178]1[164]nl
  131. 748 [152]5,tt$(j):[141]876:[139]et[178]8[167]614
  132. 750 [130]j
  133. 752 [129]i[178]1[164]nc
  134. 754 [152]5,pc(i);cr$;hc$(i):[141]876:[139]et[178]8[167]614
  135. 756 [129]n[178]1[164]3
  136. 758 [152]5,ml$(i,n):[141]876:[139]et[178]8[167]614
  137. 760 [130]n:[130]i:[152]5,[196](z);cr$;e$:[141]876:[139]et[178]8[167]614
  138. 762 [160]5:[160]15:[137]538
  139. 764 [143]----load format
  140. 766 [153]"load format from what file?"
  141. 768 [153]"  ";nf$:[133]"on";nf$:[139]nf$[178]""[167]614
  142. 770 [159]15,8,15:[159]5,8,5,"0:rp] "[170]nf$[170]",s,r":[141]876:[139]et[178]8[167]614
  143. 771 [139]en[178]62[167][141]878:[137]614
  144. 772 [132]5,pw,nl,nc:[141]876:[139]et[178]8[167]614
  145. 774 [129]j[178]1[164]nl
  146. 776 [132]5,tt$(j):[141]876:[139]et[178]8[167]614
  147. 778 [130]j
  148. 780 [129]i[178]1[164]nc
  149. 782 [132]5,pc(i),hc$(i):[141]876:[139]et[178]8[167]614
  150. 784 [129]n[178]1[164]3
  151. 786 [132]5,ml$(i,n):[141]876:[139]et[178]8[167]614
  152. 788 [130]n:[130]i:[132]5,a1$:z[178][197](a1$)
  153. 790 s[178]st:[139]s[179][177]0[167]794
  154. 792 [132]5,e$
  155. 794 [160]5:[160]15:[137]712
  156. 796 [143]----print nonformatted listing
  157. 798 [152]4,"[ record #";i;"   ]";:[129]j[178]1[164]62:[152]4,"-";:[130]j:[141]4034
  158. 800 [129]n[178]1[164]f
  159. 802 [152]4,f$(n);:[129]j[178]1[164]20[171][195](f$(n)):[152]4,".";:[130]j
  160. 804 [152]4,rec$(k%(i),n)
  161. 806 [130]n:[141]4034:[142]
  162. 808 [143]----print report
  163. 810 pg[178]0:s$[178]"":[129]j[178]1[164]pw:s$[178]s$[170]b$:[130]j
  164. 812 [129]j[178]1[164]nl:[139]tt$(j)[179][177]">"[167][141]818
  165. 814 [130]j:[142]
  166. 816 [143]----center title
  167. 818 b[178][181]((pw[171][195](tt$(j)))[173]2):[139]p[179][177]1[167]821
  168. 820 [152]4,[200](s$,b)[170]tt$(j);b1$;:pg[178]pg[170]1:[142]
  169. 821 [152]4,[200](s$,b)[170]tt$(j);b1$:pg[178]pg[170]1:[142]
  170. 822 [143]----position headings
  171. 824 [141]838:pc(nc[170]1)[178]pw[170]3:cw[178]pc(2)[171]2[171]pc(1):[139]pc(1)[177]1[167]828
  172. 826 [152]4,[200](hc$(1),cw);:[137]830
  173. 828 [152]4,[200](s$,pc(1)[171]1)[170][200](hc$(1),cw);
  174. 830 [129]j[178]2[164]nc:m[178]pc(j)[171][195]([200](hc$(j[171]1),pc(j)[171]2[171]pc(j[171]1)))[171]pc(j[171]1)
  175. 832 [152]4,[200](s$,m)[170][200](hc$(j),pc(j[170]1)[171]2[171]pc(j));
  176. 834 [130]j:[141]4034:[141]838:pg[178]pg[170]3:[142]
  177. 836 [143]----print dashed line
  178. 838 [129]j[178]1[164]pw:[152]4,"-";:[130]j:[141]4034:[142]
  179. 840 [143]----print file data
  180. 842